package system;

import java.util.HashMap;
import java.util.Map;

public class GetPageDef {
    public static final String AnPhamTapChi = "itemNode_aptc";
    public static final String CSDLCongTy = "itemNode_Dlct";
    public static final String HoiDap = "itemNode_hoidap";
    public static final String BieuDoIndex = "itemNode_sanck";
    public static final String QuanTriHeThong = "itemNode_system";
    public static final String GopYDTVB = "itemNode_dtvb";
    public static final String PhanAnhKienNghi = "itemNode_pakn";
    public static final String ThuTucHanhChinh = "itemNode_tthc";
    public static final String KhieuNaiToCao = "itemNode_Kntc";

    private static final Map<String, Map<String, String>> mapPageDef =
        new HashMap();

    public GetPageDef() {
        mapPageDef.put(AnPhamTapChi, new HashMap());
        mapPageDef.put(CSDLCongTy, new HashMap());
        mapPageDef.put(HoiDap, new HashMap());
        mapPageDef.put(BieuDoIndex, new HashMap());
        mapPageDef.put(QuanTriHeThong, new HashMap());
        mapPageDef.put(GopYDTVB, new HashMap());
        mapPageDef.put(PhanAnhKienNghi, new HashMap());
        mapPageDef.put(ThuTucHanhChinh, new HashMap());
        mapPageDef.put(KhieuNaiToCao, new HashMap());

        mapPageDef.get(AnPhamTapChi).put("itemNode_so",
                                         "pages.aptc.soPageDef");
        mapPageDef.get(CSDLCongTy).put("itemNode_Dsct",
                                       "pages.dlct.DsctPageDef");
        mapPageDef.get(HoiDap).put("itemNode_dmchude",
                                   "pages.hoidap.dmchudePageDef");
        mapPageDef.get(BieuDoIndex).put("itemNode_dmsanck",
                                        "pages.bieudoindex.dmsanckPageDef");
        mapPageDef.get(QuanTriHeThong).put("itemNode_role",
                                           "pages.system.rolePageDef");
        mapPageDef.get(GopYDTVB).put("itemNode_dmdonvi",
                                     "pages.dtvb.dmdonviPageDef");
        mapPageDef.get(PhanAnhKienNghi).put("itemNode_noidungphananhkiennghi",
                                            "pages.phananhkiennghi.noidungphananhkiennghiPageDef");
        mapPageDef.get(ThuTucHanhChinh).put("itemNode_thutuc",
                                            "pages.tthc.thutucPageDef");
        mapPageDef.get(KhieuNaiToCao).put("itemNode_khieunaitocao",
                                            "pages.kntc.khieunaitocaoPageDef");
    }

    public String getPageDef(String module, String page) {
        Map<String, String> map = mapPageDef.get(module);
        if (map != null)
            return map.get(page);
        return null;
    }
}
